---
id: fieldset
title: Fieldset
description: A set of form controls optionally grouped under a common name.
---

## Examples

The `Fieldset` component provides contexts such as `invalid` and `disabled` for form elements. While most Ark UI
components natively support these contexts, you can also use the `Field` component with standard HTML form elements.

### Basic Usage

Learn how to use the `Fieldset` component in your project. Let's take a look at the most basic example:

<Example id="basic" />

### Field

This example demonstrates how to use the `Field` component with a standard input field within a `Fieldset`.

<Example id="with-field" />

### Checkbox

This example shows how to use the `Fieldset` component with other Ark UI form elements like `Checkbox`.

<Example id="with-checkbox" />

### Root Provider

The `RootProvider` component provides a context for the fieldset. It accepts the value of the `useFieldset` hook. You
can leverage it to access the component state and methods from outside the fieldset.

<Example id="root-provider" />

> If you're using the `RootProvider` component, you don't need to use the `Root` component.

### Input with Select

This example shows how to use the `Fieldset` component with `Field.Input` and `Select` to create a interactive phone
input component.

<Example id="phone-input" />

## API Reference

<ComponentTypes id="fieldset" />
